﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Fastyou.WCF.Proxys;
using Fastyou.Model;

namespace Fastyou.WCF.Client
{
    //class DuplexCallback:IDuplexCallback
    //{
    //    #region IDuplexCallback Members

    //    public void DoneWork(DateTime date)
    //    {
    //        Console.WriteLine("the server time is {0}; client",date.ToString());
    //    }

    //    #endregion
    //}
    class DuplexCallback : IDuplexCallback
    {
        public void ChangeStatus(Work job)
        {
            Console.WriteLine("job {0}'s status is {1}.",job.WorkName,job.status);
            //foreach (ListViewItem item in listView1.Items)
            //{
            //    if (item.Text == job.WorkName)
            //    {
            //        item.SubItems[1].Text = job.status;

            //        {
            //            if (job.status == "Running")
            //            {
            //                item.ForeColor = Color.Red;
            //            }
            //            else
            //            {
            //                item.ForeColor = Color.Green;
            //            }
            //        }
            //    }
            //}
        }

        public void AddJobCall(Work job)
        {
            Console.WriteLine("add job {0},status is {1}.",job.WorkName,job.status);
            //ListViewItem item = CreateItem(job);
            //listView1.Items.Add(item);
        }
    }
}
